import type { BaseResponse } from '@/utils/request';
import { request } from '@/utils/request';
// import type { transferUserSchemas } from '@/views/system/permission/user/formSchemas';

export function updateAccountInfo(data: any) {
  return request<BaseResponse<any>>({
    url: 'account/update',
    method: 'post',
    data,
  });
}

export function updatePassword(data: any) {
  return request({
    url: 'account/password',
    method: 'post',
    data,
  });
}

export function getInfo() {
  return request<API.AdminUserInfoResult>(
    {
      url: 'sys/user/getUserInfo',
      method: 'get',
    },
    {
      isGetDataDirectly: true,
    },
  );
}

export function permmenu() {
  return request<API.PermMenuResult>(
    {
      url: 'sys/permission/getUserPermissionByToken',
      method: 'get',
    },
    {
      isGetDataDirectly: true,
    },
  );
}

export function logout() {
  return request({
    url: 'sys/logout',
    method: 'post',
  });
}
